
/**
  ******************************************************************************
  * Copyright 2021 The Microbee Authors. All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * 
  * http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * 
  * @file       sensor_airspeed_ms4525.h
  * @author     baiyang
  * @date       2023-8-1
  ******************************************************************************
  */

#pragma once

#ifdef __cplusplus
extern "C"{
#endif

/*----------------------------------include-----------------------------------*/
#include "sensor_airspeed_backend.h"

#include <device_manager/dev_mgr.h>
/*-----------------------------------macro------------------------------------*/
#ifndef MB_AIRSPEED_MS4525_ENABLED
#define MB_AIRSPEED_MS4525_ENABLED MB_AIRSPEED_BACKEND_DEFAULT_ENABLED
#endif

#if MB_AIRSPEED_MS4525_ENABLED
/*----------------------------------typedef-----------------------------------*/
typedef struct sensor_as_ms4525 *sensor_as_ms4525_t;
typedef const struct sensor_as_ms4525 *sensor_as_ms4525_const_t;

struct sensor_as_ms4525 {
    struct sensor_as_backend backend;

    float _temp_sum;
    float _press_sum;
    uint32_t _temp_count;
    uint32_t _press_count;
    float _temperature;
    float _pressure;
    uint32_t _last_sample_time_ms;
    uint32_t _measurement_started_ms;
    gp_device_t _dev;
};
/*----------------------------------variable----------------------------------*/

/*-------------------------------------os-------------------------------------*/

/*----------------------------------function----------------------------------*/
void sensor_as_ms4525_ctor(sensor_as_ms4525_t ms4525, uint8_t _instance);
sensor_as_backend_t sensor_as_ms4525_probe(uint8_t _instance);
/*------------------------------------test------------------------------------*/
#endif  // MB_AIRSPEED_MS4525_ENABLED

#ifdef __cplusplus
}
#endif



